package com.yh.mybatis.transaction;

import com.yh.mybatis.session.TransactionIsolationLevel;

import javax.sql.DataSource;
import java.sql.Connection;

public interface TransactionFactory {

    /**
     * 根据Connection创建Transaction
     *
     * @param conn 康纳。
     * @return {@link Transaction}
     */
    Transaction newTransaction(Connection conn);

    Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit);
}
